package com.kaifamiao.month03.day0323;

public class Peach {
    public static void main(String[] args) {
        forMethod();
        whileMethod();
        do_whileMethod();
    }

    public static void forMethod(){
        int last = 1;
        for(int day = 9; day > 0; day --){
            last = (last + 1)  * 2;
        }
        System.out.println(last);
    }

    public static void whileMethod(){
        int last = 1;
        int day = 9;
        while(day > 0){
            last = (last + 1) * 2;
            day --;
        }
        System.out.println(last);
    }

    public static void do_whileMethod(){
        int last = 1;
        int day = 9;
        do{
            last = (last + 1) * 2;
            day --;
        }while(day > 0);
        System.out.println(last);
    }
}
